home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
- Date: Tue, 30 Jan 1996 13:28:59 GMT
- Organization: Netcom
- Message-ID: <310e1cce.56515072@nntp.ix.netcom.com>
- References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <KANZE.96Jan26164833@gabi.gabi-soft.fr> <DLtABq.Fzu@mv.mv.com> <4edqh2$rvl@solutions.solon.com> <KANZE.96Jan29121956@slsvewt.lts.sel.alcatel.de> <TANMOY.96Jan29090518@qcd.lanl.gov> <KANZE.96Jan29201312@slsvewt.lts.sel.alcatel.de> <TANMOY.96Jan29183041@qcd.lanl.gov>
- NNTP-Posting-Host: ix-dc8-20.ix.netcom.com
- X-NETCOM-Date: Tue Jan 30 5:29:14 AM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) wrote:
-
- > In article <KANZE.96Jan29201312@slsvewt.lts.sel.alcatel.de>
- > kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
- > <snip>
- > I agree, but...
- >
- > Try naming a global function read, and see what happens (on most
- > compilers, anyway). In fact, the Posix standard requires it, and
- >
- > What should happen? It compiles perfectly and produces the expected
- > answer!
- >
- > tanmoy@qcd:tsh21540:48.0>>cat j.c
- > #include <stdio.h>
- > int read(int x) { return x + 1; }
- > int main(void) {
- > return !printf("%d\n",read(1));
- > }
- > tanmoy@qcd:tsh21540:49.0>>glintc j.c
- > tanmoy@qcd:tsh21540:50.0>>a.out
- > 2
- > tanmoy@qcd:tsh21540:51.0>>uname -a
- > SunOS qcd 4.1.4 2 sun4m
- >
- > and also
- >
- > tanmoy@qcd:tsh21540:59.0>>cat k.c
- > #include <stdio.h>
- > int read(x) { return x + 1; }
- > int main() {
- > return !printf("%d\n",read(1));
- > }
- > tanmoy@qcd:tsh21540:60.0>>cc k.c
- > tanmoy@qcd:tsh21540:61.0>>a.out
- > 2
- >
- > (By the way, your assertion is correct: in general few compilers are
- > completely conforming. My examples don't work if I change read to a
- > write :-)
-
- Perhaps you should upgrade you SunOS. Your program works fine even
- with read changed to write on the one I use with both gcc and cc:
-
- cortex:test :-) cat t.c
- #include <stdio.h>
- int write(int x) { return x + 1; }
- int main(void) {
- return !printf("%d\n",write(1));
- }
- cortex:test :-) gcc t.c
- cortex:test :-) a.out
- 2
- cortex:test :-) cc t.c
- cortex:test :-) a.out
- 2
- cortex:test :-) uname -a
- SunOS cortex 5.4 Generic_101945-36 sun4d sparc
- cortex:test :-)
-
-
- Michael M Rubenstein
-